#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
//	system("start https://www.lanqiao.cn/problems/12420/learning/");

	unordered_map<string, int> mp;
	mp["yuanxing"] = 1;
	mp["zhengfangxing"] = 2;
	mp["sanjiaoxing"] = 4;
	mp["tuoyuanxing"] = 5;
	mp["changfangxing"] = 3;
	mp["liubianxing"] = 6;


	int n;
	cin >> n;
	string s;


	int ans = 0;
	while (n--) {
		cin >> s;
		ans += mp[s];
	}
	cout << ans;

	return 0;
}
